home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / xcmds / shwdlg16.hqx / ShowDialog XCMD 1.6 / card_13328.txt < prev    next >
Text File  |  1989-05-10  |  5KB  |  132 lines

  1. -- card: 13328 from stack: in.6
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 3411
  5. -- name: Special Dialogs
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 80
  10. -- high flags: A003
  11. -- rect: left=292 top=120 right=142 bottom=398
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Splash Screen
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   lock screen
  23.   unlock screen with zoom out
  24.   if ColorOn() then
  25.     ShowDialog 5,4747,40
  26.   else ShowDialog 5,4747,42
  27. end mouseUp
  28.  
  29. -- 5 is the type
  30. -- 4747 is the DLOG resource ID
  31. -- 40 displays PICT resource 1040
  32. -- 42 displays PICT resource 1042
  33. -- 9 would have displayed PICT 1009
  34. -- 8 would have displayed PICT 1008, etc.
  35. -- The PICT to be shown is always: PICT ID - 1000
  36.  
  37.  
  38. -- part 2 (button)
  39. -- low flags: 80
  40. -- high flags: A003
  41. -- rect: left=293 top=180 right=202 bottom=399
  42. -- title width / last selected line: 0
  43. -- icon id / first selected line: 0 / 0
  44. -- text alignment: 1
  45. -- font id: 0
  46. -- text size: 12
  47. -- style flags: 0
  48. -- line height: 16
  49. -- part name: All PICT Dialog
  50. ----- HyperTalk script -----
  51. on mouseUp
  52.   ShowDialog 5,4780,50
  53. end mouseUp
  54.  
  55. -- 5 is the type
  56. -- 4780 is the DLOG resource ID
  57. -- 50 displays PICT resource 1050
  58. -- 9 would have displayed PICT 1009
  59. -- 8 would have displayed PICT 1008, etc.
  60.  
  61. -- The PICT 1050 has no button associated with it and thus will be
  62. -- shown ONLY when the dialog is initially displayed.
  63.  
  64.  
  65. -- part 4 (button)
  66. -- low flags: 00
  67. -- high flags: 0000
  68. -- rect: left=11 top=4 right=64 bottom=78
  69. -- title width / last selected line: 0
  70. -- icon id / first selected line: 529 / 529
  71. -- text alignment: 1
  72. -- font id: 0
  73. -- text size: 12
  74. -- style flags: 0
  75. -- line height: 16
  76. -- part name: SD
  77.  
  78.  
  79. -- part contents for background part 21
  80. ----- text -----
  81. Special Dialogs
  82.  
  83. -- part contents for background part 30
  84. ----- text -----
  85. 20
  86.  
  87. -- part contents for background part 18
  88. ----- text -----
  89.  
  90. ΓÇóΓÇóΓÇóΓÇóΓÇóFirst, click the demo buttons on this card.ΓÇóΓÇóΓÇóΓÇóΓÇó
  91.  
  92. These are both examples of Type 5 of ShowDialog.
  93.  
  94. ΓÇóSplash Screens
  95. Splash screens can be used to display brief information, such as an "About" box.
  96.  
  97. ΓÇóAll PICT dialogs
  98. This specialized type of dialog can be used to create interactive "help" dialogs, or to provide information about a complex user interface.
  99.  
  100. -- part contents for background part 15
  101. ----- text -----
  102. The special dialogs on this card are forms of Type 5 of ShowDialog XCMD.
  103.  
  104. Refer to the card "ShowDialog Type 5" for an explanation of the parameters.
  105.  
  106. ΓÇó Click┬áhere┬áto┬ágo┬áthere┬ánow. ΓÇó
  107.  
  108.  
  109. -- part contents for background part 17
  110. ----- text -----
  111. ΓÇó Splash Screens
  112.  
  113. In the Splash Screen example, the dialog consists only of two ENABLED useritems, DITL item#1 and item#2, that cover the entire area of the dialog box.  In this case there is NO button associated with the PICT.  The PICT that is displayed is specified in the parameter list.  It is the PICT resource ID minus 1000.  In the example, "ShowDialog 5,4747,40" displays PICT ID 1040.   (See the descriptions of SplashDialog XCMD and CreditsDialog XCMD on card 23 for some related information.)
  114.  
  115. The same thing was done for the initial screen in the SuperPaint tool palette example.  That screen couldn't be recalled because it had no associated button (or hot spot) but was shown when the dialog was first displayed.
  116.  
  117. Remember, these dialogs can display PICTs in glorious living color; something HyperCard cannot now do.
  118.  
  119. ΓÇó All PICT dialogs
  120.  
  121. In the All PICT Dialog example, the tool palette in the dialog is a DISABLED static PICT.  Lying under each tool on the palette is an ENABLED useritem that serves as the hot spot.  These hot spots are the "buttons" that change the PICTs in the display.  PICTs are associated with individual useritems in the same way as they are for buttons.  Useritem DITL item# 3 displays PICT 1003; useritem DITL item#4 displays PICT 1004, and so on (Remember, PICT ID = DITL item# +1000).
  122.  
  123. To duplicate this effect, when creating your template you must remember that the ENABLED useritems (the hot spots) MUST BE UNDER the static PICT.  To make building your template easy, do the following:
  124. ΓÇó Lay down the static PICT on the template.
  125. ΓÇó One after the other, place the ENABLED useritem hot spots where they belong on the PICT.
  126. ΓÇó If your PICT is completely covered with useritems, move one of them slightly to one side so that you can select the PICT.
  127. ΓÇó CUT the PICT to the clipboard.  You will be left with only the useritems.  If you moved one of the useritems, then put it back.
  128. ΓÇó Immediately PASTE the PICT back.  It will now be on top of the useritems with the useritems correctly placed underneath!
  129.  
  130. When the hot spot is clicked on, it will invert the pixels that comprise its area.  This serves to hilite the portion of the PICT that lies over the hot spot.
  131.  
  132.